<script setup>
defineOptions({
  name: 'WordIndex'
})

defineProps({
  words: {
    required: true,
    type: Array
  }
})
</script>
<template>
  <div class="word" v-for="item in words" :key="item.id">
    <p>{{ item.word }}</p>
    <span>{{ item.translate }}</span>
    <div class="slot">
      <slot :id="item.id" class="slot">&nbsp;</slot>
    </div>
  </div>
</template>
<style lang="less" scoped>
.word {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #b3b1b1;
  margin-bottom: 3px;
  margin-left: 10px;
  margin-right: 10px;

  p {
    width: 40%;
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    margin-top: 10px;
  }

  span {
    flex: 1;
    align-self: center;
  }
  .slot {
    width: 50px;
    height: 3px;
  }
}
</style>
